package com.tsing.cedap.rest.vo.reqVo;

import com.tsing.cedap.common.valid.AddGroup;
import com.tsing.cedap.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;

/**
 * @author TheTsing
 * @create 2022-03-29 11:16
 */
@Getter
@Setter
@Accessors(chain = true)
public class SchoolReqVo {

    @ApiModelProperty("新增不填，修改必填：id")
    @Null(message = "新增时不能传入id", groups = {AddGroup.class})
    @NotBlank(message = "id不能为空", groups = {UpdateGroup.class})
    private String id;

    @ApiModelProperty("必填：学校名称")
    @NotBlank(message = "学校名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Length(min = 1, max = 100, message = "学校名称长度需在1到100个字符", groups = {AddGroup.class, UpdateGroup.class})
    private String name;

    @ApiModelProperty("必填：学校地址")
    @NotBlank(message = "学校地址不能为空", groups = {AddGroup.class})
    @Length(min = 1, max = 200, message = "学校地址长度需在1到200个字符", groups = {AddGroup.class, UpdateGroup.class})
    private String address;

    @ApiModelProperty("必填：运营人员")
    @NotBlank(message = "运营人员不能为空", groups = {AddGroup.class})
    @Length(min = 1, max = 32, message = "运营人员长度需在1到32个字符", groups = {AddGroup.class, UpdateGroup.class})
    private String userId;

    @ApiModelProperty("必填：描述")
    @NotBlank(message = "描述不能为空", groups = {AddGroup.class})
    @Length(min = 1, max = 200, message = "运营人员长度需在1到200个字符", groups = {AddGroup.class, UpdateGroup.class})
    private String description;

}
